package com.twu.biblioteca.menu;

import com.twu.biblioteca.Index;
import com.twu.biblioteca.Reserver;
import com.twu.biblioteca.user.User;

public class MenuItemFactory {
    private static final MenuInputReader reader = new MenuInputReader();

    public static MovieList createMovieList(User user, Index index)
    {
        String title = "Movies";
        if(user.isLoggedIn())
        {
            return new MovieListAuthorized(title, user, index, reader);
        }
        return new MovieList(title, user, index, reader);
    }

    public static BookList createBookList(User user, Index index) {
        String title = "Books";
        if(user.isLoggedIn())
        {
            Reserver reserver = new Reserver();
            return new BookListAuthorized(title, user, index, reserver, reader);
        }
        return new BookList(title, user, index, reader);
    }

    public static MembershipDetails createMembershipDetails(User user) {
        String title = "Member Details";
        if(user.isLoggedIn())
        {
            return new MembershipDetailsAuthorized(title, user, reader);
        }
        return new MembershipDetails(title, user);
    }
}
